/*
EP3D is a real-time 3D planet engine , which in addition to providing 
substandard scene rendering and scene management, of course, it also 
provides some basic class libraries to build the entire virtual 
planet, or even the entire universe.

Copyright (C) 2010  Hongjiang Zhang	(zhjwyat@gmail.com)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef EP3D_ATTRIBUTE_H
#define EP3D_ATTRIBUTE_H
#include "EP3DRefCounter.h"
#include "EP3DTypeArray.h"
#include "EP3DPointer.h"

namespace EP3D
{
	enum AttributeType
	{
		AT_INT,
		AT_F32,
		AT_F64,
		AT_BOOL,
		AT_ENUM,
		AT_STRING,
		AT_INTARRAY,
		AT_F32ARRAY,
		AT_F64ARRAY,
		AT_BOOLARRAY,
		AT_STRINGARRAY,
		AT_UNKNOWN
	};

	SmartPointer(Attribute);
	class EP3DEXPORT Attribute
		:public AutoRefCounter
	{
	public:
		virtual ~Attribute(){}

		virtual int GetInt() const	{ return 0; }
		virtual void SetInt(int val)	{}
		
		virtual f32 GetF32() const	{ return 0; };
		virtual void SetF32(f32 val)	{}

		virtual f64 GetF64() const	{ return 0; }
		virtual void SetF64(f64 val)	{}

		virtual bool GetBool() const	{ return false; }
		virtual void SetBool(bool val)	{}

		virtual String GetString() const	{ return String(); }
		virtual void SetString(const String& val)	{}
		virtual void SetString(const TCHAR* val)	{}

		virtual IntArray GetIntArray() const	{ return IntArray(); }
		virtual void SetIntArray(const Array<int>& val)	{}

		virtual F32Array GetF32Array() const	{ return F32Array(); }
		virtual void SetF32Array(const F32Array& val)	{}

		virtual F64Array GetF64Array() const	{ return F64Array(); }
		virtual void SetF64Array(const F64Array& val)	{}

		virtual BoolArray GetBoolArray() const	{ return BoolArray(); }
		virtual void SetBoolArray(const BoolArray& val)	{}

		virtual StringArray GetStringArray() const	{ return StringArray(); }
		virtual void SetStringArray(const StringArray& val)	{}

		virtual const TCHAR* GetEnum() { return 0; }
		virtual void SetEnum(const TCHAR* val, const TCHAR* const* literals) {};

		virtual AttributeType GetType() const = 0;
		virtual const TCHAR* GetTypeString() const = 0;

		String m_kName;
	};
}

#endif